//
//  EFTransHomeDetailViewCellTwo.m
//  EnjogFood
//
//  Created by guocheng on 2017/5/19.
//  Copyright © 2017年 wf. All rights reserved.
//

#import "EFTransHomeDetailViewCellPrice.h"
#import "EFTransHomeDetailViewItemPrice.h"

@interface EFTransHomeDetailViewCellPrice()

@property(strong,nonatomic) UILabel* nameLabel;
@property(strong,nonatomic) UILabel* moneyLabel;

@end

@implementation EFTransHomeDetailViewCellPrice



-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self){
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.contentView.backgroundColor = [UIColor clearColor];
        self.backgroundColor = [UIColor whiteColor];
        [self initView];
    }
    return self;
}

-(void)initView{
    [self.contentView addSubview:self.nameLabel];
    [self.contentView addSubview:self.moneyLabel];
}

-(void)layoutSubviews{
    self.nameLabel.left = 20;
    self.nameLabel.top = 14;
    
    self.moneyLabel.top =14;
    
}

-(void)setObject:(EFTransHomeDetailViewItemPrice *)item{
    [self.nameLabel setText:item.name];
    [self.nameLabel sizeToFit];
    self.nameLabel.top = 11;
    self.nameLabel.left = 20;

    NSString* strMoney = [NSString stringWithFormat:@"%@",item.money];
    [self.moneyLabel setText:strMoney];
    [self.moneyLabel sizeToFit];
    
    self.moneyLabel.top = 11;
    self.moneyLabel.left = kScreenWidth -  self.moneyLabel.width - 20;
}


-(UILabel*)nameLabel{
    if(_nameLabel == NULL){
        _nameLabel = [[UILabel alloc] init];
        _nameLabel.font = [UIFont systemFontOfSize:13];
        _nameLabel.textColor = kBlack999;
    }
    return _nameLabel;
}

-(UILabel*)moneyLabel{
    if(_moneyLabel == NULL){
        _moneyLabel = [[UILabel alloc] init];
        _moneyLabel.font = [UIFont systemFontOfSize:13];
        _moneyLabel.textColor = kBlack999;
    }
    return _moneyLabel;
}



@end
